-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extended magnetic mapping #222
Conversation
- This my crude attempt to allow mapping between rho_pol_norm <-> rho_tor_norm - This also includes phi - I qualitatively tested rho_pol_norm -> rho_tor_norm - Might have some COCOS issues - Probably overly complicated - Needs dynamic fetching of `phi` and `rho_pol_norm`
I see this PR is labeled as WIP, so ignoring for now. |
- Tested against mapping form OMFITprofiles - Results are OK by eye. Numerical verification still pending.
omas/omas_physics.py
Outdated
from scipy.interpolate import InterpolatedUnivariateSpline | ||
psi_grid = ods["equilibrium"]["time_slice"][time_index]["profiles_1d"]["psi"] | ||
psi_mask = mask_SOL(ods, time_index, psi_grid) | ||
phi_grid = ods["equilibrium"]["time_slice"][time_index]["profiles_1d"]["psi"][psi_mask] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a bug using this definition, phi_grid = psi_grid[psi_mask]
omas/omas_physics.py
Outdated
+ ods["equilibrium"]["time_slice"][time_index]["global_quantities"]["psi_axis"]) | ||
elif origin == "rho_tor_norm": | ||
phi = values**2 | ||
phi *= np.array([ods["equilibrium"]["time_slice"][time_index]["global_quantities"]["psi_boundary"]]) / np.max(phi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phi is normalized or real poloidal flux? Because you should multiply it by phi_boundary
not by psi_boundary
also, why are you normalizing it by np.max(phi)? What it somebody use as values rho_tor = 0.5? It will force it to be one, always.
omas/omas_physics.py
Outdated
psi_spl = InterpolatedUnivariateSpline(phi_grid, psi_grid[psi_mask]) | ||
phi_min = np.min(phi_grid) | ||
phi_max = np.max(phi_grid) | ||
values_mask = np.logical_ant(values > phi_min, values < phi_max) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.logical_ant(values > phi_min, values < phi_max) is the same as (values > phi_min)&(values < phi_max)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I literally put a bug in this line xD (a logical ant to be specific)
- Results seem good now
Stale pull request message |
phi
andrho_pol_norm